<div class="admin_left actions">
	<h3 style="font-size:20px;"><?php echo __('Manage more'); ?></h3>
    <ul>
            <li style="list-style-type:none; margin-left:0; padding-top:15px;"><?php echo $this->Html->link(__('Edit Group'), array('action' => 'edit', $group['Group']['id'])); ?> </li>
            <li style="list-style-type:none; margin-left:0; padding-top:15px;"><?php echo $this->Form->postLink(__('Delete Group'), array('action' => 'delete', $group['Group']['id']), null, __('Are you sure you want to delete # %s?', $group['Group']['id'])); ?> </li>
            <li style="list-style-type:none; margin-left:0; padding-top:15px;"><?php echo $this->Html->link(__('List Groups'), array('action' => 'index')); ?> </li>
            <li style="list-style-type:none; margin-left:0; padding-top:15px;"><?php echo $this->Html->link(__('New Group'), array('action' => 'add')); ?> </li>
            <li style="list-style-type:none; margin-left:0; padding-top:15px;"><?php echo $this->Html->link(__('List Customers'), array('controller' => 'customers', 'action' => 'index')); ?> </li>
            <li style="list-style-type:none; margin-left:0; padding-top:15px;"><?php echo $this->Html->link(__('New Customer'), array('controller' => 'customers', 'action' => 'add')); ?> </li>
    </ul>
</div>




<?php if ($is_admin): ?>
        <div class="admin_right groups view">
                <h2><?php  echo __('Group'); ?></h2>
                <table class="table table-striped table-bordered">
                    <tr>
                            <th><?php echo __('Id'); ?></th>
                            <th><?php echo __('Name'); ?></th>
                    </tr>

                    <tr>
                            <td>
                                    <?php echo h($group['Group']['id']); ?>
                                    &nbsp;
                            </td>

                            <td>
                                    <?php echo h($group['Group']['name']); ?>
                                    &nbsp;
                            </td>
                    </tr>
                </table>


                <div class="related">
                        <h3><?php echo __('Related Customers'); ?></h3>
                        <?php if (!empty($group['Customer'])): ?>
                            <table cellpadding = "0" cellspacing = "0" class="table table-striped table-bordered">
                                <tr>
                                        <th><?php echo __('Id'); ?></th>
                                        <th><?php echo __('First Name'); ?></th>
                                        <th><?php echo __('Last Name'); ?></th>

                                        <th><?php echo __('Username'); ?></th>

                                        <th><?php echo __('Email'); ?></th>

                                        <th class="actions"><?php echo __('Actions'); ?></th>
                                </tr>

                                <?php $i = 0; foreach ($group['Customer'] as $customer): ?>
                                    <tr>
                                        <td><?php echo $customer['id']; ?></td>
                                        <td><?php echo $customer['first_name']; ?></td>
                                        <td><?php echo $customer['last_name']; ?></td>

                                        <td><?php echo $customer['username']; ?></td>

                                        <td><?php echo $customer['email']; ?></td>

                                        <td class="actions">
                                                <?php echo $this->Html->link(__('View'), array('controller' => 'customers', 'action' => 'view', $customer['id'])); ?>
                                                <?php echo $this->Html->link(__('Edit'), array('controller' => 'customers', 'action' => 'edit', $customer['id'])); ?>
                                                <?php echo $this->Form->postLink(__('Delete'), array('controller' => 'customers', 'action' => 'delete', $customer['id']), null, __('Are you sure you want to delete # %s?', $customer['id'])); ?>
                                        </td>
                                    </tr>
                                <?php endforeach; ?>
                            </table>
                        <?php endif; ?>

                            <div  style="margin-left:75%;" class="actions">
                                    <ul>
                                            <li style="list-style-type:none; margin-left:0; padding-top:15px;"><?php echo $this->Html->link(__('Add Customer to this group'), array('controller' => 'customers', 'action' => 'add')); ?> </li>
                                    </ul>
                            </div>
                </div>
        </div>
<?php else: ?>
        <p>YOU ARE NOT SUPPOSED TO VIEW THIS PAGE!!!</p>
<?php endif; ?>
